<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="dist/css/quicktab.css">
</head>

<body>
    <button onclick="call2()">关闭当前激活的tab</button>
    <div id="qtab"></div>
    <script src="dist/js/quicktab.js"></script>
    <script>
        const tab = new Quicktab('#qtab', {
            id: 'qtab',
            defaultTabs: [
                { url: 'welcome.html' },
                { url: 'welcome.html?page=1', title: '欢迎页面' },
            ],
            toolbar: {
                dropdown: {
                    enable: true
                }
            },
            tab: {
                contextmenu: {
                    enable: true,
                    close: {
                        enable: false
                    }
                }
            }
        })

        function call2() {
            tab.closeActiveTab()
        }
    </script>
</body>

</html>